#pragma once 

#include <Atom.h>
#include <properties/DependencyProperty.h>
#include <memory>
#include <WowPtr.h>
#include <boost/noncopyable.hpp>

namespace liba {
namespace properties {

class PropertyContainer
	: public virtual WowPointable
	, private boost::noncopyable
{
public:
	virtual AbstractDependencyProperty* FindProperty(const Atom& name);

	template<typename T>
	BaseDependencyProperty<T>* FindProperty(const Atom& name)
	{
		AbstractDependencyProperty* adp = FindProperty(name);
		if (!adp)
			return 0;
		return dynamic_cast<BaseDependencyProperty<T>*>(adp);
	}

	virtual void RegisterProperty(const Atom& name, AbstractDependencyProperty* prop);
protected:
	~PropertyContainer() { }
private:
	typedef std::map<Atom, AbstractDependencyProperty*> Properties;
	Properties properties;
};

} // namespace properties
} // namespace liba